{extend name='admin@main'}
{block name="button"}
{if auth("export")}
<!-- <button id="export" style="margin-left:10px" class='layui-btn layui-btn-warm layui-btn-sm'><i class="layui-icon">&#xe601;</i>导出数据</button> -->
{/if}
{if auth("order_detail_index")}
<a data-dbclick class="layui-btn layui-btn-sm" data-title="台账" data-open='{:url("order_detail/index")}?plan_id={$Think.get.plan_id}&back=1'>台账 <i class="layui-icon layui-icon-release"></i></a>
{/if}
{/block}
{block name="content"}
<div class="think-box-shadow">
    {empty name='Think.get.back'}
        {include file='plan_detail/index_search'}
    {/empty}
    
    <table class="layui-table" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
            </th>
            <th class='text-left nowrap'>仓库</th>
            <th class='text-left nowrap'>运营计划</th>
            <th class='text-center nowrap'>类型</th>
            <th class='text-center nowrap'>分类</th>
            <th class='text-center nowrap'>属性</th>
            <th class='text-center nowrap'>岗位</th>
            <th class='text-center nowrap'>结算方式</th>
            <th class='text-center nowrap'>是否含税</th>
            <th class='text-left nowrap'>主体名称</th>
            <th class='text-left nowrap'>单价</th>
            <th class='text-left nowrap'>日补贴</th>
            <th class='text-left nowrap'>数量</th>
            <th class='text-left nowrap'>原因</th>
            <th class='text-left nowrap'>作业人员</th>
            <th class='text-left nowrap'></th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'>
                <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
            </td>
            <td class='text-left nowrap'>{$vo.ware_house_name|default=''}</td>
            <td class='text-left nowrap'>{$vo.plan_date|default=''}</td>
            <td class='text-center nowrap'>
                {eq name='vo.type' value='0'}<span class="layui-badge layui-bg-blue">运力</span>{/eq}
                {eq name='vo.type' value='1'}<span class="layui-badge layui-bg-green">分拣</span>{/eq}
            </td>
            <td class='text-center nowrap'>
                {eq name='vo.classify' value='0'}<span class="layui-badge layui-bg-blue">固定</span>{/eq}
                {eq name='vo.classify' value='1'}<span class="layui-badge layui-bg-orange">临时</span>{/eq}
            </td>
            <td class='text-center nowrap'>
                {eq name='vo.att' value='0'}<span class="layui-badge layui-bg-blue">车队</span>{/eq}
                {eq name='vo.att' value='1'}<span class="layui-badge layui-bg-orange">个人</span>{/eq}
                {eq name='vo.att' value='2'}<span class="layui-badge layui-bg-green">劳务</span>{/eq}
                {eq name='vo.att' value='3'}<span class="layui-badge layui-bg-gray">自招</span>{/eq}
            </td>
            <td class='text-center nowrap'>
                {eq name='vo.jobs' value='0'}<span class="layui-badge layui-bg-blue">有车</span>{/eq}
                {eq name='vo.jobs' value='1'}<span class="layui-badge layui-bg-orange">无车</span>{/eq}
                {eq name='vo.jobs' value='2'}<span class="layui-badge layui-bg-green">标品</span>{/eq}
                {eq name='vo.jobs' value='3'}<span class="layui-badge layui-bg-gray">冻品</span>{/eq}
                {eq name='vo.jobs' value='4'}<span class="layui-badge layui-bg-cyan">大件</span>{/eq}
                {eq name='vo.jobs' value='5'}<span class="layui-badge">杂工</span>{/eq}
            </td>
            <td class='text-center nowrap'>
                {eq name='vo.payment_way' value='0'}<span class="color-red">周结</span>{/eq}
                {eq name='vo.payment_way' value='1'}<span class="color-green">月结</span>{/eq}
                {eq name='vo.payment_way' value='2'}<span class="color-desc">无</span>{/eq}
            </td>
            <td class='text-center nowrap'>
                {eq name='vo.is_rate' value='0'}<span class="color-red">否</span>{/eq}
                {eq name='vo.is_rate' value='1'}<span class="color-green">是</span>{/eq}
            </td>
            <td class='text-left nowrap'>
                {$vo.body_names|default='-'}
            </td>
            <td class='text-left nowrap'>{$vo.price|default='-'}</td>
            <td class='text-left nowrap'>{$vo.subsidy|default='-'}</td>
            <td class='text-left nowrap'>{$vo.count|default='-'}</td>
            <td class='text-left nowrap'>{$vo.reason|default='-'}</td>
            <td class='text-left nowrap' style="width: 10px">
                {empty name='vo.users'}暂未分配{else}<span class="color-blue">已分配</span>{/empty}
            </td>
            <td class='text-left nowrap'>
                <!-- {empty name='vo.uids'} -->
                {if auth("edit")}
                <a data-dbclick class="layui-btn layui-btn-sm" data-title="分派作业人员" data-modal='{:url("edit")}?id={$vo.id}'>分派作业人员</a>
                {/if}
                <!-- {else} -->
                {if auth("look")}
                <a data-dbclick class="layui-btn layui-btn-sm layui-btn-warm" data-title="查看" data-modal='{:url("look")}?id={$vo.id}'>查看</a>
                {/if}
                <!-- {/empty} -->
                
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>
<script>
    //导出数据
    $('#export').on('click',function(){
        var search = location.hash.split("?")[1];
        location.href="{:url('export')}?" + search;
    })
</script>
{/block}
